﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProjectN.Core.Instance;

namespace ProjectN.Core.Fore
{
    public record PageInfo(Instance.Instance Instance, Guid Guid)
    {
        public DynamicPage Page => Instance.RequirePage(Guid);
        public static PageInfo NewPage(Instance.Instance instance) => new(instance, Guid.NewGuid());
    }

    public static class PageInfoExtensions
    {
        public static PageInfo GetMajorInfo(this Instance.Instance instance) => new(instance, instance.MajorGuid);
        public static PageInfo GetPageInfo(this Instance.Instance instance, Guid guid) => new(instance, guid);
    }
}
